package adapterpattern;

public class AudioPlayer implements AdvancedMediaPlayer {
	public AdvancedMediaAdapter advancedMediaAdapter = new AdvancedMediaAdapter();

	@Override
	public void playMp4(String fileName) {
		advancedMediaAdapter.playMp4(fileName);
	}

	@Override
	public void playVlc(String fileName) {
		advancedMediaAdapter.playVlc(fileName);
	}
	
	public void play(String audioType,String fileName){
		if(audioType.equalsIgnoreCase("mp3")){
			advancedMediaAdapter.mediaPlayer.playMp3(fileName);
		}else if(audioType.equalsIgnoreCase("mp4")){
			this.playMp4(fileName);
		}else if(audioType.equalsIgnoreCase("vlc")){
			this.playVlc(fileName);
		}else{
			System.out.println("Invalid media file...");
		}
	}
	
}
